package com.luzh.myspring.bean.model;

import com.luzh.myspring.beans.factory.annotation.Autowired;
import com.luzh.myspring.beans.factory.annotation.Qualifier;
import com.luzh.myspring.beans.factory.annotation.Value;
import com.luzh.myspring.stereotype.Component;



@Component
public class Book {
    @Value("三国演义${book.version}")
    private String name;

    @Autowired
    @Qualifier("user")
    private User user;

    @Value("50.05")
    private double price;

    public Book() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getPrice() {
        return price;
    }


    public String print() {
        return "Book{" +
                "name='" + name + '\'' +
                ", user=" + user +
                ", price=" + price +
                '}';
    }
}
